/*
 * Simulator
 * Date: December 09, 2011
 * Group JEDi
 * Author(s): James Lovato, Efim Todorasco, Daniel Garrison
 */

/**
 * A class that holds to current state of the Process while
 * it is on any of the queues.
 * 
 * @author James Lovato, Efim Todorasco, Daniel Garrison
 * @version Fall 2011
 *
 */
public class PCB {

	/**
	 * A static value that increments to give a unique
	 * id value to each process.
	 */
	public static int nextID = 0;
	
	/**
	 * The Process's unique ID value.
	 */
	int pid;
	
	/**
	 * The Process's next instruction upon continuation.
	 */
	int nextStep;
	
	/**
	 * The current state of the process when on a queue.
	 */
	State state = State.READY;
	
	/**
	 * Constructor that sets the PCB's unique id value.
	 */
	public PCB() {
		pid = nextID++;
		nextStep = 0;
	}
	
	/**
	 * Sets the next step so the Process will know where 
	 * it left off upon restart up.
	 * @param step The next step in the Process's instruction set.
	 */
	public void setStep(final int step) {
		nextStep = step;
	}
}
